#ifndef CONSOS_H
#define CONSOS_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QVariant>

class consos
{
public:
    explicit consos();
    consos(int);

    void updateDatabase();

    //seter
    void setNom(QString);
    void setPrix(double);
    void setStock(int, int);
    void setCommentaire(QString);
    void setCategorie(int);
    void setActif(bool);
    void addMotsclefs(QString);
    void delMotsclefs(int);

    //geter
    QString getNom();
    double getPrix();
    int getStock();
    QString getCommentaire();
    int getCategorie();
    QString getCategorieName();
    QStringList getMotsclefs();
    int getId();
    bool getActif();

private:
    QString nom;
    double prix;
    int stock;
    QStringList motsclefs;
    QString commentaire;
    int categorie;
    int id;
    bool actif;

    QSqlDatabase db;

    void Init();
    void setMotsclefs();

signals:

public slots:


};

#endif // CONSOS_H
